<template>
  <div class="detail-info card">
    <h2 class="section-title">活动详情</h2>
    
    <div class="info-section">
      <h3>活动说明</h3>
      <p>{{ activity.description }}</p>
    </div>

    <div class="info-section">
      <h3>费用说明</h3>
      <div class="fee-info">
        <p>费用类型：{{ getFeeMode }}</p>
        <p v-if="activity.feeAmount">费用金额：¥{{ activity.feeAmount }}</p>
        <p v-if="activity.depositAmount">押金金额：¥{{ activity.depositAmount }}</p>
        <p>{{ activity.feeDescription }}</p>
      </div>
    </div>

    <div class="info-section">
      <h3>人数限制</h3>
      <p>最少参与人数：{{ activity.minParticipants }}人</p>
      <p>最多参与人数：{{ activity.maxParticipants }}人</p>
      <p>当前报名人数：{{ activity.currentParticipants }}人</p>
    </div>

    <div class="info-section">
      <h3>难度等级</h3>
      <p>{{ getDifficultyLevel }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { computed } from 'vue';

const props = defineProps({
  activity: {
    type: Object,
    required: true
  }
});

const getFeeMode = computed(() => {
  const modes = {
    FREE: '免费',
    PAID: '付费',
    DEPOSIT: '押金'
  };
  return modes[props.activity.feeMode] || props.activity.feeMode;
});

const getDifficultyLevel = computed(() => {
  const levels = {
    EASY: '简单',
    MEDIUM: '中等',
    HARD: '困难',
    EXPERT: '专业'
  };
  return levels[props.activity.difficultyLevel] || props.activity.difficultyLevel;
});
</script>

<style scoped lang="scss">
.detail-info {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;

  .section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  .info-section {
    margin-bottom: 16px;

    h3 {
      font-size: 16px;
      font-weight: bold;
      margin: 0 0 8px;
      color: #333;
    }

    p {
      margin: 4px 0;
      color: #666;
      line-height: 1.5;
    }
  }
}
</style>